Repository navigation
fix(backup): a different filesystem is not a different machine — /dev/shm is refused, and the self-test stops calling it a medium - #596
Merged
Conversation
…/shm is refused, and the self-test stops calling it a medium `make backup-offsite DEST=/dev/shm` ran to its green line on 2026-09-21, an hour after the script merged: 1.7 GB into tmpfs on a host with 216 MB free, gone on the next reboot, and a recorded `offsite-copy` success buying ninety days of silence from OffsiteCopyStale for a copy that existed nowhere. The guard compared filesystems and tmpfs is a different filesystem. That check was never the claim the ADR made for it. Three refusals now, ordered so each gives its own diagnosis: an in-memory or synthetic filesystem (tmpfs, ramfs, overlay and friends) wherever it is mounted; a destination under /tmp, /run, /dev, /proc or /sys whatever is mounted there, since a separate /tmp partition passes the other two; and the filesystem the sets already live on, which is the original device check, kept. Then a warning — not a refusal — when the destination does not report as removable, because a second internal disk and a network mount are legitimate for someone who has decided so, and no check here can establish the property the ADR actually requires: that the medium leaves the house. The self-test is where this was really written in. It handed the copy fixtures /dev/shm and called it the medium, on the reasoning that it is a different filesystem from /tmp — true, and the exact mistake. A real stand-in needs a loop mount, which needs root, which CI does not have, so the copy fixtures now set OFFSITE_UNSAFE_SKIP_MEDIUM_CHECKS (which prints a loud warning on any run that sets it) and every refusal gets a fixture with it unset, tmpfs first. The same-filesystem fixture moves out of /tmp so the volatile-path check does not shadow the one under test. 24 fixtures, up from 22. ADR-0048 is immutable, so it gains a note recording the correction rather than an edit. The runbook says plainly what a green line does not prove, and the failure table gains the three new symptoms. The same overclaim is corrected in schedule-maintenance.md, install-timers.sh and backup.rules.yaml. The false success on the monitoring host was cleared by hand and the tmpfs copy removed; #573's first real visit has still not happened. Refs #573. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Sep 21, 2026
Gerrrt
added a commit
that referenced
this pull request
Sep 22, 2026
…etes The only conflict is scripts/validate.sh, and both sides edit the block this branch removes. #610 rewrote the comment above backup-offsite.sh's self-test to say that /dev/shm is a refusal FIXTURE and not a destination — a different filesystem that is still this host's RAM, which is the #596 regression — and to widen the refusal list to an in-memory filesystem and a tree cleared on boot. Taking this branch's side would have dropped that correction with the comment it lives in, so it is carried into scripts/self-tests.sh's header instead, which is where the reason each suite exists now lives. Nothing else on main touches this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
6 of 7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What happened
An hour after #588 merged, the first real invocation was
make backup-offsite DEST=/dev/shm. It ran to its green line:1.7 GB into tmpfs on a host with 216 MB free, gone on the next reboot, and a recorded
offsite-copysuccess buying ninety days of silence fromOffsiteCopyStalefor a copy that existed nowhere. That is the failure class ADR-0048 exists to prevent — a copy read with confidence — reproduced by the tool written to prevent it.The guard compared filesystems.
/dev/shmis a different filesystem. It is also this host's RAM. The check was never the claim the ADR made for it.The fix
Three refusals, ordered so each gives its own diagnosis rather than whichever fires first:
tmpfs,ramfs,overlay,squashfs, the synthetic onesis a … filesystem, which is not a medium/tmp,/run,/dev,/proc,/syswhich this host clears or recreateson the same filesystem as the sets it would copy(the original check, kept)The middle one exists because a host with a separate
/tmppartition passes the other two. Then a warning, not a refusal, when the destination does not report as removable: a second internal disk and a network mount are legitimate for someone who has decided so, and no check here can establish what the ADR actually requires — that the medium leaves the house.The self-test is where this was really written in
It handed the copy fixtures
/dev/shmand called it the medium, on the reasoning that it is a different filesystem from/tmp. True, and the exact mistake — the trap got written into the tests instead of caught by them.A real stand-in needs a loop mount, which needs root, which CI does not have. So the copy fixtures set
OFFSITE_UNSAFE_SKIP_MEDIUM_CHECKS, which prints a loud warning on any run that sets it, and every refusal gets a fixture with it unset — tmpfs first. The same-filesystem fixture moves out of/tmpso the volatile-path check does not shadow the one under test. 24 fixtures, up from 22.Documents
ADR-0048 is immutable, so it gains a note recording the correction rather than an edit, plus a second note saying what no check can establish. The runbook now says plainly what a green line does not prove, with
/dev/shmnamed as the case that bit, and the failure table gains the three new symptoms. The same overclaim is corrected inschedule-maintenance.md,install-timers.shandbackup.rules.yaml.Done on the host, outside this PR
offsite-copy.promremoved, so the false success no longer vouches for anything. No copy has been made, which is again what the metrics say.#573's first real visit has still not happened.
Refs #573.
🤖 Generated with Claude Code